'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
    const { router, controller } = app;
    //接口和控制器之间的对应关系
    router.get('/api/list', controller.home.list);
    router.get('/api/studentlist',controller.student.list);
    //添加
    router.post('/api/add',controller.student.add);
    //删除
    router.delete('/api/del',controller.student.del);
    //修改
    router.put('/api/update',controller.student.update);
    //restful风格接口定义  一组接口 crud
    router.resources('userlist','/api/userlist',controller.userlist);
};
